<div class="form">
<?php if(Yii::app()->user->hasFlash('success')):?>
   <div class="flash-success" style="color:white;background-color:#669966;">
   <?php echo Yii::app()->user->getFlash('success'); ?>
</div>
<?php endif; ?>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'options-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
<?php 
$status='published';
$objects = Questions::model()->findAll('status=?',array($status));
$arr = array();
foreach ($objects as $obj) {
     $arr[$obj->id] = $obj->title;
}?>
	<div class="row">
		<?php echo $form->labelEx($model,'question_id'); ?>
		<?php echo $form->dropDownList($model,'question_id',$arr); ?>
		<?php echo $form->error($model,'question_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'correct_option'); ?>
		<?php echo $form->dropDownList($model,'correct_option',array('yes'=>'yes','no'=>'no')); ?>
		<?php echo $form->error($model,'correct_option'); ?>
	</div>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->